//Brian Goodacre

//headers
#include "mpi.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <unistd.h>

//MPI tags for passing messages
#define UPLOAD_PREPARE_TAG 1
#define UPLOAD_READY_TAG 2
#define UPLOAD_START_TAG 3
#define UPLOAD_START_OLD_TAG 4
#define COMMAND_UPLOAD_TAG 10
#define COMMAND_PRINT_SERVER_DATA_TAG 11
#define COMMAND_PRINT_SERVER_DATA_DONE_TAG 12
#define COMMAND_PRINT_COMPUTER_DATA_TAG 13
#define COMMAND_PRINT_COMPUTER_DATA_DONE_TAG 14
#define COMMAND_RANDOMIZE_COMPUTER_DATA_TAG 15
#define COMMAND_RANDOMIZE_COMPUTER_DATA_DONE_TAG 16
#define COMMAND_RANDOMIZE_SERVER_ALL_DATA_TAG 17
#define COMMAND_RANDOMIZE_SERVER_ALL_DATA_DONE_TAG 18
#define COMMAND_RANDOMIZE_SERVER_ONE_DATA_TAG 19
#define COMMAND_RANDOMIZE_SERVER_ONE_DATA_DONE_TAG 20
#define COMMAND_RANDOMIZE_SERVER_ONE_DATA_MORE_TAG 21
#define COMMAND_DISCONNECT_FROM_INTERNET_TAG 22
#define COMMAND_CONNECT_TO_INTERNET_TAG 23
#define COMMAND_SYNC_TAG 24
#define COMMAND_SYNC2_TAG 25
#define COMPUTER_VERSION_TAG 30
#define COMPUTER_DOWNLOAD_TAG 31
#define SERVER_UPLOAD_TAG 40
#define SERVER_VERSION_TAG 41
#define SERVER_DOWNLOAD_TAG 42
#define SERVER_DOWNLOAD_REQUEST_TAG 43
#define SERVER_REFRESH_TAG 44


#define KILL_TAG 100

//constant values
#define default_storage_array_size 10
#define max_random_number 10 
#define max_choices_from_file 100 //not needed anymore
#define server_process 1
#define command_line_process 0
